package org.middleware.dao.system;

import org.middleware.entity.system.SysEnterprises;
import org.middleware.mapper.system.SysEnterprisesMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class SysEnterprisesDao {

    @Autowired
    private SysEnterprisesMapper enterprisesMapper;

    public List<SysEnterprises> getEnterprises() {
        return enterprisesMapper.getEnterprises();
    };

    public SysEnterprises getEnterpriseByID(int id) {
        return enterprisesMapper.getEnterpriseByID(id);
    }

    public int createEnterprise(SysEnterprises enterprises) {
        return enterprisesMapper.createEnterprise(enterprises);
    }

    public int update(SysEnterprises enterprises) {
        return enterprisesMapper.update(enterprises);
    }

    public SysEnterprises getEnterprisesByCode(String code) {
        return enterprisesMapper.getEnterprisesByCode(code);
    }

    public List<SysEnterprises> getEnterprisesOfCurrentUser(int userId) {
        return enterprisesMapper.getEnterprisesOfCurrentUser(userId);
    }

}
